Skip to content

feat(hyrox): live double-tap bursts close HYROX rounds - #13

Draft
BucciMobile wants to merge 7 commits into
feat/hyrox-reconciler-callerfrom
feat/hyrox-live-taps
Draft

BucciMobile wants to merge 7 commits into
feat/hyrox-reconciler-callerfrom
feat/hyrox-live-taps

Conversation

@BucciMobile

Copy link
Copy Markdown
Owner

Summary

Live tracking while the phone is connected: double-tap bursts on the band close HYROX rounds in real time (follow-up to OpenStrap#663 storage + the reconciler-caller PR).

  • New lib/state/hyrox_live_taps.dart: LiveBurstDetector (pure, unit-tested) + HyroxLiveTapHandler. Same burst rule as the offline reconciler: >=3 double-taps (event 14) within 6 s anchored on the FIRST tap — a chained 0/6/12 s sequence does NOT count — plus per-station minimum-duration floors.
  • Fed from AppState._onLiveEvent (foreground/live path only; the headless drain never reaches it, same guard as the gesture dispatcher). A burst starts an armed race (startSegment), closes the open round (transitionSegment), or finishes the final round (finishSegment); all stamped boundarySource: 'gesture'.
  • The active session is re-read from the DB on every accepted burst, so a relaunch or reconciler-applied boundaries are picked up; the offline reconciler ignores taps at/before the last recorded boundary, so live + offline are idempotent together. Finalized/discarded sessions are never touched; rejections are logged, never thrown into the event path.
  • Tests: test/hyrox_live_taps_test.dart — pure burst detector (anchoring, chained rejection, gate), full race start->transitions->finish against sqflite_ffi, floor rejection, non-tap/zero-ts ignored, finalized untouched.

Base: feat/hyrox-reconciler-caller (stacked). No UI yet, no haptics (deferred by request). CI runs analyze + tests; no Flutter SDK in the dev sandbox.

mistral-vibe and others added 3 commits November 3, 2026 09:39
New HyroxLiveTapHandler (lib/state/hyrox_live_taps.dart), fed from
AppState._onLiveEvent on the foreground/live path only (never the headless
drain). Same burst rule as the offline reconciler: >=3 double-taps within 6 s
anchored on the FIRST tap (chained 0/6/12 s does not count), per-station
minimum floors, boundaries stamped 'gesture'. A burst starts an armed race,
closes the open round, or finishes the final one; activeSession is re-read
per accepted burst so relaunch/reconciler state is picked up. Finalized and
discarded sessions are never touched; rejections are logged, never thrown.

Co-authored-by: BucciMobile <BucciMobile@users.noreply.github.com>
Co-authored-by: BucciMobile <BucciMobile@users.noreply.github.com>
Co-authored-by: BucciMobile <BucciMobile@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Co-authored-by: BucciMobile <BucciMobile@users.noreply.github.com>
Co-authored-by: BucciMobile <BucciMobile@users.noreply.github.com>
Co-authored-by: BucciMobile <BucciMobile@users.noreply.github.com>
@BucciMobile

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Action not completed

Head commit changed.

Co-authored-by: BucciMobile <BucciMobile@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants